<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib prefix="sys" uri="/WEB-INF/tld/sys.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>借款管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">

    <div id="ligergrid1" class="sq-grid"></div>
</div>



<script type="text/javascript">
    var grid = null;
    $(function () {
        initGrid();
        $("#pageloading").hide();
    });

    /* 初始化列表*/
    function initGrid(){
        var url = '<%=path%>/finance/finRepayApplyInfo/selectDetailList.do?payDtlRId=${payDtlRId}';
        grid = $("#ligergrid1").ligerGrid({
                url:url,
                method: 'get',
                columns: [
                    { display: '流程编号', name: 'pNo',  width: 300, enabledSort:false,
                        render: function (rowdata, rowindex, value, column) {
                            if(StringUtils.isEmpty(value)){
                                value = "";
                            }
                            var h = '';
                            h='<a href="javascript:showFlow(';
                            h+="'"+rowdata.pInstId+"',";
                            h+="'"+rowdata.audStsCd+"',";
                            h+="'"+rowdata.dataId+"',";
                            h+="'"+rowdata.formUrl+"'";
                            h+=')">'+value+'</a>'
                            return h;
                        }
                    },
                    {
                        display: '还款金额(元)', name: 'repayAmt', width: 150, align: 'center', enabledSort: false,
                        render: function (rowdata, index, value) {
                            return '&yen;' + FormatMoney(rowdata.repayAmt / 100);
                        }
                    },
                    {display: '还款状态', name: 'repayStsCd', width: 150, align: 'center', enabledSort: false},
                    {display: '申请还款时间', name: 'repayTm', width: 100, align: 'center', enabledSort: false,render: renderDate},
                ],
                pageSize: 10,
                root: 'rows',
                record: 'total',
                hideLoadButton: true,
                width: '100%',
                height: '100%',
                heightDiff: -2,
                allowUnSelectRow: true,
                alternatingRow: false,
               checkbox:false,//列表是否有选择框
               // enabledEdit: true,//是否能编辑
               rownumbers:true,//列表是否有行号

            onBeforeShowData: function () {
                    var grid = this;
                    grid.collapsedRows = [];
                }
            })
        grid.setHeight(100);
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

    //到流程跟踪页
    function showFlow(pInstId,audStsCd,dataId,formUrl){

        if(StringUtils.isEmpty(pInstId)){
            UIUtils.alertWarning(CommonConstant.C_P_INSTANCEID_NOT_HERE);
            return;
        }
        var params = "?pInsId="+pInstId+"&status="+audStsCd+"&businessKey="+dataId+"&formUrl="+formUrl;
        Add_navTab('finloaninfo'+pInstId,'查看流程',"<%=path%>/flow/flow/toFlowShowPageFowBus.do"+params);
    }

</script>

</body>
</html>
